Repository navigation
fix(host): stop calling a checkpointed current part "in your context" (#2774) - #2776
Conversation
|
@Birfy — review request at tip Risk tier: T2 ( What it changes: the current-part branch of the Readings: red first on the clean base with Product's READY file → Files (6): Not run, and why, in the body: the smoke bench (this build root has no No further writes from us at this tip unless a review asks for a change. |
…nkFlowLab#2774) The checkpoint probe called deriveMessages directly, so a Session that reports its messages by throwing would turn read_own_chat({ part: N }) into a failed tool call. The count is a hint only: read it as zero on a throw, the way a Session without the method already reads, and cover it with a guard test.
e5759ef to
17717c2
Compare
|
@Birfy — review request at the new tip Risk tier: T2 ( What the second commit adds. Our independent advisory (FlyBot Test) found a new failure surface this PR introduced: Readings at this tip: Substance is unchanged from the earlier request: the current-part branch no longer calls a checkpointed part "in your context"; with a checkpoint it names No further writes from us at this tip unless a review asks for a change. |
|
Verdict: PASS at 17717c2 Ran at this tip: Not run: What I checked independently, not from the PR text:
Fixes #2774. |
Fixes #2774
Owner: Dev-1
Reviewer: Birfy
Written-by: Dev-1
Claim-Id: 56390d8dd72f4567845e457e4452b68f
Base: f2ef4df
Risk tier: T2
What changed
read_own_chat({ part: N })answered the current part withPart N is the current one; it is in your context.unconditionally. A checkpoint condenses a part's older messages in place (parts.jsswaps the Session's summarizer forwriteCheckpoint()), so after any checkpoint that sentence is false exactly where the prompt asks the reader to notice — and a Bot that trusted it skipped the read it needed.core/src/host/groups.jsnow resolves the part's Session and counts its checkpoints withsteward.jscheckpointCount(agent.session.deriveMessages()):[Checkpoint N], shows the newest lineslatestOwnChatstill returns, and points at the words search for the rest.deriveMessagesis called optionally (agent?.session?.deriveMessages?.()): the bench Sessions incore/test/group-work.test.jshave none, and a hard call would make everypart Ntest throw instead of assert. The call is also wrapped (try/catch, count0on a throw): a Session whosederiveMessagesfails is a hint this answer cannot use, not a reason for the tool to fail, so it keeps the old sentence instead of turning a read into an error. The ended-part handoff note andYour own chat has no part N.are unchanged; no new state field, no client change.Red first, on the clean base
f2ef4dfa, the READY test copied tocore/test/tmp-p656.test.js:The committed test with the source change reverted (
git checkout -- core/src/host/groups.js, everything else the same):With the change,
core/test/group-work.test.jsis 28/28 (# tests 28 / # pass 28 / # fail 0) — the 27 above plus the one guard below.That
deriveMessages-throws case is a guard, not red-first: it is green on the base as well, because the base never callsderiveMessagesat all. It pins behaviour that only the change could break —core/test/group-work.test.jsgivesagentOf('b').session.deriveMessagesa body that throwsnew Error('session is gone')and asserts the answer is stillPart 1 is the current one; it is in your context.and that the tool does not throw. With the try/catch removed fromgroups.jsand the test kept, the same file is# tests 28 / # pass 27 / # fail 1, and the failure is that guard — so it bites exactly the regression it exists for.Verification at the tip
Verified commit: f6c16d87f96d41b3670019cd8e31f9718062a071 (tree
be36d6eca156585e984cdf5cf81b7a354bfb55c5).Head: 17717c2 (same tree, rebuilt by the push helper on live
main)Ran:
TZ=UTC npm run verify— exit 0; core 3139/3139, plugins social 619, tree 140, timeline 161, workflow 508;.github/scripts+policy671; interop 37; live-e2e 34 — 0 fail everywhere.ARCH_DOCS_BASE=f2ef4dfa npm --prefix core run arch-docson the committed tree →arch-docs: OK (6 changed file(s)).node scripts/ds-bot-patches.mjs check→ok core/ equals ds-bot/ + patches/ds-bot/;generatere-run for this commit, sopatches/ds-bot/0001-core-fixes.patchandpatches/ds-bot/0012-room-membership.patchcarry the change andcheckis green on them.node .github/scripts/check-empty-catch.mjs→ no violation.Not run (and why): the smoke test (
core/dev/bench.sh smoke) — this build root has no DSH checkout (../deepseek-harnessabsent,DSH_HARNESSunset), so the bench cannot start. The CIpackagejob's pack check, typecheck and actionlint are not part ofnpm run verify.Files
core/src/host/groups.js,core/test/group-work.test.js,docs/subsystems/core-host.md,patches/ds-bot/0001-core-fixes.patch,patches/ds-bot/0012-room-membership.patch,changelog.d/2774-part-checkpoint-context.fixed.mdCheckpoint
{ "pr": 2776, "claim": "Dev-1", "issue": 2774, "summary": "read_own_chat({part: N}) no longer calls a checkpointed current part in context. It resolves the part's Session, counts checkpoints with steward's checkpointCount, and with one names [Checkpoint N], shows the newest lines still in context and points at the words search. Without a checkpoint the answer is byte-identical, and the ended-part and missing-part answers are unchanged. deriveMessages is called optionally and wrapped, so a Session without it, or one whose call throws, keeps the old sentence instead of failing the read; a guard test pins the throw.", "files": ["core/src/host/groups.js", "core/test/group-work.test.js", "docs/subsystems/core-host.md", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0012-room-membership.patch", "changelog.d/2774-part-checkpoint-context.fixed.md"], "checks": { "ran": "TZ=UTC npm run verify; ARCH_DOCS_BASE=f2ef4dfa npm --prefix core run arch-docs; node scripts/ds-bot-patches.mjs check", "result": "green", "at": "17717c245447c5492fed0b8d72301404d149f1bd" }, "next": "none — ready for review" }